import { request } from "/utils/request/index.js";
const BASE_URL = "https://pss-ams-stg1.pa18.com";
// 查询是否弹出

// 查询触点问题
export async function askRankContact(url, params = {}) {
  return new Promise((resolve) => {
    let xhr = new XMLHttpRequest();
    xhr.open("GET", `${BASE_URL}/ams/dynamicScene/verity.loginFree`, true);
    xhr.send();
    return (xhr.onreadystatechange = () => {
      if (xhr.readyState === 4 && xhr.status === 200) {
        params.timeEncryption = JSON.parse(xhr.responseText).data;
        resolve(request(`${BASE_URL}${url}`, params));
      }
    });
  });
}
